package com.njtoyo.taxi.admin.library.wechat;

import lombok.SneakyThrows;
import me.chanjar.weixin.cp.api.WxCpGroupRobotService;
import me.chanjar.weixin.cp.api.WxCpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author Dell
 * @Date 2021/5/31 15:15
 */
@Component
public class WechatMessageSender {

    @Autowired
    private WxCpService wxCpService;

    @SneakyThrows
    public void sendGroupRobotMsg(String webHookUrl,String content){
        WxCpGroupRobotService groupRobotService =
                wxCpService.getGroupRobotService();
        groupRobotService.sendMarkdown(webHookUrl,content);
    }

}
